#include <iostream>
using std::cout;
using std::endl;

class Point{
public:
    void print(){
        cout << _x << "," << _y << endl;
    }

private:
    int _x;
protected:
    int _y;
};
//保护继承
//子类的内部：除了private无法访问其他均可以访问到
class Point3D : protected Point{
public:
    void func(){
       // cout << _x << endl;error
        cout << _y << endl;
        print();
    }



};
//保护性继承时，第三代的表现
class Point4D : public Point3D{
public:
    void display(){
        //cout << _x << endl;error
        cout << _y << endl; 
        print();
    }
};

//类的外部：基类里面的所有的成员均无法访问到
void test(){
    Point3D pt3d;
    pt3d.func();
    //pt3d.print();error
    //pt3d._x;
    //pt3d._y;
}

int main()
{
    test();
    return 0;
}

